package Legend.Stages.Rooms is


   -- 内场景的大小为64 X 64, 每个内场景由6层构成(底层, 地表, 建筑, 事件, 建筑横坐标, 建筑纵坐标)
   -- 内场景的地图由allsin.grp或s?.grp指定, 每层中的编号为16位整数(x)

   subtype Room_Layer_Type is Layer_Type(0 .. Room_Height - 1, 0 .. Room_Width - 1);

   type Room_Type is new Stage_Type with record
      From : access Stage_Type'Class;
      Story_Timer : Hash_Type := 0;
      Talk_With_Wei : Boolean := False;
   end record;

   type Room_Access is access all Room_Type'Class;

   overriding
   procedure Load_Map (this : in out Room_Type);

   overriding
   procedure Load_Heroes (this : in out Room_Type);

   overriding
   function Find_Scene_At (
      this  : in out Room_Type;
      Door  : Point_Type;
      Scene : out Uint16_t
      ) return Boolean;

   overriding
   procedure Finalize (this : in out Room_Type);

   overriding
   procedure Use_Story_Item (this : in out Room_Type; Item : in out Item_Type);

   overriding
   procedure On_Key_Up (
      this          : in out Room_Type;
      Message       : SDL.Events.Keyboard_Event_t;
      Cancel_Bubble : in out Boolean
      );

   overriding
   procedure On_Timer (
      this          : in out Room_Type;
      Timer         : Hash_Type;
      Count         : Natural;
      Cancel_Bubble : in out Boolean
      );

   overriding
   procedure On_Passby (this : in out Room_Type);

   overriding
   procedure Shopping (this : in out Room_Type);

   overriding
   procedure On_Before_Run (this : in out Room_Type);

private

   overriding
   procedure On_Popup_Menu (
      this : in out Room_Type;
      Menubar : in out Menus.Menubar_Pointer
      );

   overriding
   procedure On_Command (
      this : in out Room_Type;
      Command : Integer
      );

   procedure On_Room_Menu_Item (this : in out Room_Type);

   procedure On_Room_Menu_Exit (this : in out Room_Type);

end Legend.Stages.Rooms;
